Integrand size = 25, antiderivative size = 52 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=-b x+\frac {a \text {arctanh}(\cos (c+d x))}{2 d}-\frac {b \cot (c+d x)}{d}-\frac {a \cot (c+d x) \csc (c+d x)}{2 d} \]
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.03 (sec) , antiderivative size = 109, normalized size of antiderivative = 2.10 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=-\frac {a \csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}-\frac {b \cot (c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-\tan ^2(c+d x)\right )}{d}+\frac {a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}-\frac {a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {a \sec ^2\left (\frac {1}{2} (c+d x)\right )}{8 d} \]
-1/8*(a*Csc[(c + d*x)/2]^2)/d - (b*Cot[c + d*x]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[c + d*x]^2])/d + (a*Log[Cos[(c + d*x)/2]])/(2*d) - (a*Log[Sin[( c + d*x)/2]])/(2*d) + (a*Sec[(c + d*x)/2]^2)/(8*d)
Time = 0.39 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.04, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.320, Rules used = {3042, 3317, 3042, 3091, 3042, 3954, 24, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos (c+d x)^2 (a+b \sin (c+d x))}{\sin (c+d x)^3}dx\) |
\(\Big \downarrow \) 3317 |
\(\displaystyle a \int \cot ^2(c+d x) \csc (c+d x)dx+b \int \cot ^2(c+d x)dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a \int \sec \left (c+d x-\frac {\pi }{2}\right ) \tan \left (c+d x-\frac {\pi }{2}\right )^2dx+b \int \tan \left (c+d x+\frac {\pi }{2}\right )^2dx\) |
\(\Big \downarrow \) 3091 |
\(\displaystyle a \left (-\frac {1}{2} \int \csc (c+d x)dx-\frac {\cot (c+d x) \csc (c+d x)}{2 d}\right )+b \int \tan \left (c+d x+\frac {\pi }{2}\right )^2dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a \left (-\frac {1}{2} \int \csc (c+d x)dx-\frac {\cot (c+d x) \csc (c+d x)}{2 d}\right )+b \int \tan \left (c+d x+\frac {\pi }{2}\right )^2dx\) |
\(\Big \downarrow \) 3954 |
\(\displaystyle a \left (-\frac {1}{2} \int \csc (c+d x)dx-\frac {\cot (c+d x) \csc (c+d x)}{2 d}\right )+b \left (-\int 1dx-\frac {\cot (c+d x)}{d}\right )\) |
\(\Big \downarrow \) 24 |
\(\displaystyle a \left (-\frac {1}{2} \int \csc (c+d x)dx-\frac {\cot (c+d x) \csc (c+d x)}{2 d}\right )+b \left (-\frac {\cot (c+d x)}{d}-x\right )\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle a \left (\frac {\text {arctanh}(\cos (c+d x))}{2 d}-\frac {\cot (c+d x) \csc (c+d x)}{2 d}\right )+b \left (-\frac {\cot (c+d x)}{d}-x\right )\) |
b*(-x - Cot[c + d*x]/d) + a*(ArcTanh[Cos[c + d*x]]/(2*d) - (Cot[c + d*x]*C sc[c + d*x])/(2*d))
3.11.55.3.1 Defintions of rubi rules used
Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( n_), x_Symbol] :> Simp[b*(a*Sec[e + f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Simp[b^2*((n - 1)/(m + n - 1)) Int[(a*Sec[e + f*x])^m*( b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] & & NeQ[m + n - 1, 0] && IntegersQ[2*m, 2*n]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n _.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[a Int[(g*Co s[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Simp[b/d Int[(g*Cos[e + f*x])^ p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]
Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d *x])^(n - 1)/(d*(n - 1))), x] - Simp[b^2 Int[(b*Tan[c + d*x])^(n - 2), x] , x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 0.28 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.37
method | result | size |
derivativedivides | \(\frac {a \left (-\frac {\cos ^{3}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{2}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+b \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(71\) |
default | \(\frac {a \left (-\frac {\cos ^{3}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{2}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+b \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(71\) |
parallelrisch | \(\frac {-a \left (\cot ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -8 b x d -4 b \cot \left (\frac {d x}{2}+\frac {c}{2}\right )-4 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+4 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d}\) | \(76\) |
risch | \(-b x -\frac {i \left (i a \,{\mathrm e}^{3 i \left (d x +c \right )}+i a \,{\mathrm e}^{i \left (d x +c \right )}+2 b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 b \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}\) | \(103\) |
norman | \(\frac {-\frac {a}{8 d}+\frac {a \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}-\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d}+\frac {b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-b x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-b x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}\) | \(148\) |
1/d*(a*(-1/2/sin(d*x+c)^2*cos(d*x+c)^3-1/2*cos(d*x+c)-1/2*ln(csc(d*x+c)-co t(d*x+c)))+b*(-cot(d*x+c)-d*x-c))
Leaf count of result is larger than twice the leaf count of optimal. 114 vs. \(2 (48) = 96\).
Time = 0.29 (sec) , antiderivative size = 114, normalized size of antiderivative = 2.19 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=-\frac {4 \, b d x \cos \left (d x + c\right )^{2} - 4 \, b d x - 4 \, b \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, a \cos \left (d x + c\right ) - {\left (a \cos \left (d x + c\right )^{2} - a\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (a \cos \left (d x + c\right )^{2} - a\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \]
-1/4*(4*b*d*x*cos(d*x + c)^2 - 4*b*d*x - 4*b*cos(d*x + c)*sin(d*x + c) - 2 *a*cos(d*x + c) - (a*cos(d*x + c)^2 - a)*log(1/2*cos(d*x + c) + 1/2) + (a* cos(d*x + c)^2 - a)*log(-1/2*cos(d*x + c) + 1/2))/(d*cos(d*x + c)^2 - d)
\[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=\int \left (a + b \sin {\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )} \csc ^{3}{\left (c + d x \right )}\, dx \]
Time = 0.37 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.27 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=-\frac {4 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} b - a {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{4 \, d} \]
-1/4*(4*(d*x + c + 1/tan(d*x + c))*b - a*(2*cos(d*x + c)/(cos(d*x + c)^2 - 1) + log(cos(d*x + c) + 1) - log(cos(d*x + c) - 1)))/d
Time = 0.33 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.83 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 8 \, {\left (d x + c\right )} b - 4 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 4 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {6 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 4 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \]
1/8*(a*tan(1/2*d*x + 1/2*c)^2 - 8*(d*x + c)*b - 4*a*log(abs(tan(1/2*d*x + 1/2*c))) + 4*b*tan(1/2*d*x + 1/2*c) + (6*a*tan(1/2*d*x + 1/2*c)^2 - 4*b*ta n(1/2*d*x + 1/2*c) - a)/tan(1/2*d*x + 1/2*c)^2)/d
Time = 9.95 (sec) , antiderivative size = 151, normalized size of antiderivative = 2.90 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=\frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {b\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {a\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2\,d}-\frac {2\,b\,\mathrm {atan}\left (\frac {2\,b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {a\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d} \]
(b*tan(c/2 + (d*x)/2))/(2*d) - (b*cot(c/2 + (d*x)/2))/(2*d) - (a*log(sin(c /2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/(2*d) - (2*b*atan((2*b*cos(c/2 + (d*x)/ 2) + a*sin(c/2 + (d*x)/2))/(a*cos(c/2 + (d*x)/2) - 2*b*sin(c/2 + (d*x)/2)) ))/d - (a*cot(c/2 + (d*x)/2)^2)/(8*d) + (a*tan(c/2 + (d*x)/2)^2)/(8*d)